<?php

declare(strict_types=1);

namespace App\CustHub\Constants;

use App\Common\Constants\AbstractBaseConstants;
use Hyperf\Constants\Annotation\Constants;

/**
 * 朋友圈任务状态
 */
#[Constants]
class FrdCircTaskStatusConstants extends AbstractBaseConstants
{
    /**
     * @Message("创建中")
     */
    public const CREATING = 0;

    /**
     * @Message("待发布")
     */
    public const WAITING = 1;

    /**
     * @Message("执行中")
     */
    public const EXECUTING = 2;

    /**
     * @Message("已完成")
     */
    public const COMPLETED = 3;

    /**
     * @Message("已取消")
     */
    public const CANCELLED = 4;


    public static function convertToTaskStatus($status)
    {
        if($status==self::CREATING) return CrowSendingConstants::WAIT_CRATE;
        if($status==self::WAITING) return CrowSendingConstants::WAIT_SEND;
        if($status==self::EXECUTING) return CrowSendingConstants::SENDING;
        if($status==self::COMPLETED) return CrowSendingConstants::COMPLETE;
        if($status==self::CANCELLED) return CrowSendingConstants::CANCEL;
    }

}